home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat2 / standard / prctl.z / prctl
Encoding:
Text File  |  2001-04-17  |  18.6 KB  |  331 lines

  1.  
  2.  
  3.  
  4. PPPPRRRRCCCCTTTTLLLL((((2222))))                                                              PPPPRRRRCCCCTTTTLLLL((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      prctl - operations on a process
  10.  
  11. CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////rrrreeeessssoooouuuurrrrcccceeee....hhhh>>>>
  14.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////pppprrrrccccttttllll....hhhh>>>>
  15.  
  16.      ppppttttrrrrddddiiiiffffffff____tttt pppprrrrccccttttllll ((((uuuunnnnssssiiiiggggnnnneeeedddd ooooppppttttiiiioooonnnn,,,, ............))));;;;
  17.  
  18. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.      _pppp_rrrr_cccc_tttt_llll provides information about processes and the ability to control
  20.      certain of their attributes.  The return type _p_t_r_d_i_f_f__t is used so that
  21.      _pppp_rrrr_cccc_tttt_llll can return an integral value that is large enough to return a
  22.      pointer/address.  _o_p_t_i_o_n specifies one of the following actions:
  23.  
  24.      PPPPRRRR____MMMMAAAAXXXXPPPPRRRROOOOCCCCSSSS      returns the system imposed limit on the number of
  25.                       processes per user.
  26.  
  27.      PPPPRRRR____MMMMAAAAXXXXPPPPPPPPRRRROOOOCCCCSSSS     returns the maximum number of processors the calling
  28.                       process can utilize.  If the caller is restricted (see
  29.                       _ssss_yyyy_ssss_mmmm_pppp(2)) to run on a particular processor then
  30.                       PPPPRRRR____MMMMAAAAXXXXPPPPPPPPRRRROOOOCCCCSSSS will return 1.  If some of the processors
  31.                       in the complex have been restricted (see _mmmm_pppp_aaaa_dddd_mmmm_iiii_nnnn(1))
  32.                       these will not be counted.
  33.  
  34.      PPPPRRRR____IIIISSSSBBBBLLLLOOOOCCCCKKKKEEEEDDDD     returns 1 if the specified process is currently blocked.
  35.                       The second argument, interpreted as type _pppp_iiii_dddd______tttt,
  36.                       specifies the target process's pid.  Passing in 0
  37.                       implies the caller.  Since other processes could have
  38.                       subsequently unblocked the subject process, the result
  39.                       should be considered as a snapshot only.
  40.  
  41.      PPPPRRRR____GGGGEEEETTTTSSSSTTTTAAAACCCCKKKKSSSSIIIIZZZZEEEE  returns the current process's maximum stack size in
  42.                       bytes.  This size is an upper limit on the size of the
  43.                       current process's stack.
  44.  
  45.      PPPPRRRR____SSSSEEEETTTTSSSSTTTTAAAACCCCKKKKSSSSIIIIZZZZEEEE  sets the maximum stack size for the current process.
  46.                       This affects future stack growths and forks only.  The
  47.                       new value, suitably rounded, is returned.  The second
  48.                       argument, interpreted as an _rrrr_llll_iiii_mmmm______tttt, defines the desired
  49.                       stack size in bytes.  This option and the RRRRLLLLIIIIMMMMIIIITTTT____SSSSTTTTAAAACCCCKKKK
  50.                       option of _ssss_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2) act on the same value.
  51.  
  52.      PPPPRRRR____UUUUNNNNBBBBLLLLKKKKOOOONNNNEEEEXXXXEEEECCCC   sets a flag so that when the calling process
  53.                       subsequently calls _eeee_xxxx_eeee_cccc(2), the process whose pid is
  54.                       specified by the second argument is unblocked.  This can
  55.                       be used in conjunction with the PPPPRRRR____BBBBLLLLOOOOCCCCKKKK option of
  56.                       _ssss_pppp_rrrr_oooo_cccc(2) to provide race-free process creation.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. PPPPRRRRCCCCTTTTLLLL((((2222))))                                                              PPPPRRRRCCCCTTTTLLLL((((2222))))
  71.  
  72.  
  73.  
  74.      PPPPRRRR____SSSSEEEETTTTEEEEXXXXIIIITTTTSSSSIIIIGGGG    controls whether all members of a share group will be
  75.                       signaled if any one of them leaves the share group
  76.                       (whether via _eeee_xxxx_iiii_tttt(2) or _eeee_xxxx_eeee_cccc(2) or as the result of an
  77.                       abnormal termination, such as caused by a segmentation
  78.                       violation or an uncatchable signal).  If the second
  79.                       argument, interpreted as an _iiii_nnnn_tttt is 0, then normal IIIIRRRRIIIIXXXX
  80.                       process termination rules apply, namely that the parent
  81.                       might be sent a SSSSIIIIGGGGCCCCLLLLDDDD upon death of child, but no
  82.                       indication of death of parent is given.  If the second
  83.                       argument is a valid signal number [see _ssss_iiii_gggg_nnnn_aaaa_llll(2)] then
  84.                       if any member of a share group leaves the share group, a
  85.                       signal is sent to ALL surviving members of the share
  86.                       group.
  87.  
  88.      PPPPRRRR____SSSSEEEETTTTAAAABBBBOOOORRRRTTTTSSSSIIIIGGGG   controls whether all members of a share group will be
  89.                       signaled if any one of them exits the share group
  90.                       unnaturally.  This option works like PPPPRRRR____SSSSEEEETTTTEEEEXXXXIIIITTTTSSSSIIIIGGGG ,,,,
  91.                       except that the signal is not generated if the share
  92.                       group member exits normally, that is, by way of _eeee_xxxx_iiii_tttt(2)
  93.                       or _eeee_xxxx_eeee_cccc(2).  Further, the PPPPRRRR____SSSSEEEETTTTAAAABBBBOOOORRRRTTTTSSSSIIIIGGGG and
  94.                       PPPPRRRR____SSSSEEEETTTTEEEEXXXXIIIITTTTSSSSIIIIGGGG actions cannot be in effect
  95.                       simultaneously; a call which specifies either of these
  96.                       nullifies any previous calls for these actions.
  97.  
  98.      PPPPRRRR____RRRREEEESSSSIIIIDDDDEEEENNNNTTTT      makes the process immune to process swapout.  Its pages
  99.                       are still subject to paging - these can be locked by
  100.                       using _mmmm_pppp_iiii_nnnn(2).
  101.  
  102.      PPPPRRRR____TTTTEEEERRRRMMMMCCCCHHHHIIIILLLLDDDD     causes the calling process to be automatically sent a
  103.                       SSSSIIIIGGGGHHHHUUUUPPPP when its parent process dies.  This effect is NNNNOOOOTTTT
  104.                       inherited: it applies _o_n_l_y to the process that requested
  105.                       it.  The caller must have set its handler for SSSSIIIIGGGGHHHHUUUUPPPP to
  106.                       either be caught or SSSSIIIIGGGG____DDDDFFFFLLLL.  Note that processes
  107.                       started in the background have their SSSSIIIIGGGGHHHHUUUUPPPP handler set
  108.                       to SSSSIIIIGGGG____IIIIGGGGNNNN by the shell.  Child processes getting a
  109.                       SSSSIIIIGGGGHHHHUUUUPPPP signal should probably check the value of
  110.                       _gggg_eeee_tttt_pppp_pppp_iiii_dddd(2) to be sure their parent really died (and thus
  111.                       their parent pid will be set to 1).
  112.  
  113.      PPPPRRRR____AAAATTTTTTTTAAAACCCCHHHHAAAADDDDDDDDRRRR    attaches the virtual segment containing the address
  114.                       given by the third argument in the process whose pid is
  115.                       given by the second argument to the calling process.
  116.                       The second argument (pid) is interpreted as a _pppp_iiii_dddd______tttt.
  117.                       The third argument (address) is interpreted as a
  118.                       _cccc_aaaa_dddd_dddd_rrrr______tttt.  Both processes must be members of the same
  119.                       share group.  The address of where the virtual segment
  120.                       was attached is returned.  This address has the same
  121.                       logical offset into the virtual space as the passed in
  122.                       address.  A process may always attach a portion of its
  123.                       address space back onto itself without being a share
  124.                       group process.
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. PPPPRRRRCCCCTTTTLLLL((((2222))))                                                              PPPPRRRRCCCCTTTTLLLL((((2222))))
  137.  
  138.  
  139.  
  140.      PPPPRRRR____AAAATTTTTTTTAAAACCCCHHHHAAAADDDDDDDDRRRRPPPPEEEERRRRMMMM
  141.                       performs the same function as PR_ATTACHADDR but allows
  142.                       the caller to specify the desired protection attributes
  143.                       of the attach which must be a subset of the attributes
  144.                       on the region being attached.  Also returns to the
  145.                       caller additional information about the region attached,
  146.                       like base address and size of region.  In order to allow
  147.                       the additional attributes, the second argument is a
  148.                       pointer to the input parameter block which is of type
  149.                       prattach_args_t and the third argument is a pointer to
  150.                       the return values and is of type prattach_results_t.
  151.                       Intended for use by MPI libraries.
  152.  
  153.      PPPPRRRR____DDDDEEEETTTTAAAACCCCHHHHAAAADDDDDDDDRRRR    is not implemented yet.
  154.  
  155.      PPPPRRRR____GGGGEEEETTTTSSSSHHHHMMMMAAAASSSSKKKK     returns the mask stating which resources are being
  156.                       shared with the share group member whose pid is
  157.                       specified by the second argument.  It can also be used
  158.                       to gather information about the existence of other
  159.                       processes.  If the second argument is 0 or equal to the
  160.                       callers pid, then the callers share mask is returned.
  161.                       If the caller is not a member of a share group then an
  162.                       error is returned.  If the process specified by the
  163.                       second argument does not exist, is not a member of the
  164.                       callers share group, or the caller does not have
  165.                       permission to query the process, an error is returned.
  166.                       If the caller and target process are in the same share
  167.                       group the bit-wise 'and' of the callers share mask and
  168.                       the target process's share mask is returned.
  169.  
  170.      PPPPRRRR____GGGGEEEETTTTNNNNSSSSHHHHAAAARRRREEEE     returns the number of processes in the share group.  If
  171.                       the calling process has never been part of a share group
  172.                       0 is returned.
  173.  
  174.      PPPPRRRR____CCCCOOOORRRREEEEPPPPIIIIDDDD       Changes the name of the file used to hold the core image
  175.                       of the process from _cccc_oooo_rrrr_eeee to _cccc_oooo_rrrr_eeee_...._p_i_d.  The second
  176.                       argument is interpreted as a _pppp_iiii_dddd______tttt and specifies which
  177.                       process to act on.  A value of 0 signifies the calling
  178.                       process.  If the third argument, interpreted as an _iiii_nnnn_tttt,
  179.                       is zero then the core file name is changed back to the
  180.                       standard name - _cccc_oooo_rrrr_eeee.  This state is inherited on
  181.                       _ffff_oooo_rrrr_kkkk(2) and _ssss_pppp_rrrr_oooo_cccc(2) and is reset on _eeee_xxxx_eeee_cccc(2).  Note that
  182.                       this mechanism may be defeated by some system wide
  183.                       configuration settings.
  184.  
  185.      PPPPRRRR____IIIINNNNIIIITTTT____TTTTHHHHRRRREEEEAAAADDDDSSSS  prepares a process for multi-threaded operation.
  186.  
  187.      PPPPRRRR____TTTTHHHHRRRREEEEAAAADDDD____CCCCTTTTLLLL    Detailed control operations for threaded processes.
  188.  
  189.      PPPPRRRR____LLLLAAAASSSSTTTTSSSSHHHHEEEEXXXXIIIITTTT    Reserved for last sproc exit
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. PPPPRRRRCCCCTTTTLLLL((((2222))))                                                              PPPPRRRRCCCCTTTTLLLL((((2222))))
  203.  
  204.  
  205.  
  206.      _pppp_rrrr_cccc_tttt_llll will fail if one or more of the following are true:
  207.  
  208.      [ESRCH]     The second argument passed with the PPPPRRRR____IIIISSSSBBBBLLLLOOOOCCCCKKKKEEEEDDDD,
  209.                  PPPPRRRR____UUUUNNNNBBBBLLLLKKKKOOOONNNNEEEEXXXXEEEECCCC, PPPPRRRR____CCCCOOOORRRREEEEPPPPIIIIDDDD, or PPPPRRRR____GGGGEEEETTTTSSSSHHHHMMMMAAAASSSSKKKK option doesn't
  210.                  match the pid of any process.
  211.  
  212.      [EINVAL]    _o_p_t_i_o_n is not valid.
  213.  
  214.      [EINVAL]    The value given for the new maximum stack size is negative or
  215.                  exceeds the maximum process size allowed.
  216.  
  217.      [EINVAL]    The value given for the PPPPRRRR____SSSSEEEETTTTEEEEXXXXIIIITTTTSSSSIIIIGGGG option is not a valid
  218.                  signal number.
  219.  
  220.      [EINVAL]    The calling process already has specified a process (or the
  221.                  specified process is the caller itself) to be unblocked on
  222.                  exec via the PPPPRRRR____UUUUNNNNBBBBLLLLKKKKOOOONNNNEEEEXXXXEEEECCCC option.
  223.  
  224.      [EINVAL]    The PPPPRRRR____GGGGEEEETTTTSSSSHHHHMMMMAAAASSSSKKKK option was specified and the second argument
  225.                  does not correspond to a pid of a process that is in the
  226.                  caller's share group.
  227.  
  228.      [EINVAL]    The PPPPRRRR____GGGGEEEETTTTSSSSHHHHMMMMAAAASSSSKKKK option was specified and the caller is not a
  229.                  share group member.
  230.  
  231.      [EINVAL]    the _PPPP_RRRR______AAAA_TTTT_TTTT_AAAA_CCCC_HHHH_AAAA_DDDD_DDDD_RRRR_PPPP_EEEE_RRRR_MMMM call has an invalid flag set in the
  232.                  flag member of the input argument of type struct
  233.                  prattach_args_t. The only valid flag is _PPPP_RRRR_AAAA_TTTT_TTTT_AAAA_CCCC_HHHH______AAAA_LLLL_IIII_GGGG_NNNN.
  234.  
  235.      [EACCES]    The caller of the _PPPP_RRRR______AAAA_TTTT_TTTT_AAAA_CCCC_HHHH_AAAA_DDDD_DDDD_RRRR does not have the correct
  236.                  permissions to attach to the address space.
  237.  
  238.      [EACCES]    The caller of the _PPPP_RRRR______AAAA_TTTT_TTTT_AAAA_CCCC_HHHH_AAAA_DDDD_DDDD_RRRR_PPPP_EEEE_RRRR_MMMM does not have the correct
  239.                  permissions to attach to the address space.
  240.  
  241.      [EBUSY]     There is no kernel memory available at the moment to complete
  242.                  the PPPPRRRR____IIIINNNNIIIITTTT____TTTTHHHHRRRREEEEAAAADDDDSSSS operation.
  243.  
  244.      [EFAULT]    The third argument of the _PPPP_RRRR______AAAA_TTTT_TTTT_AAAA_CCCC_HHHH_AAAA_DDDD_DDDD_RRRR points to a memory
  245.                  address that is not in a valid part of the process address
  246.                  space.
  247.  
  248.      [EFAULT]    The second argument of the _PPPP_RRRR______AAAA_TTTT_TTTT_AAAA_CCCC_HHHH_AAAA_DDDD_DDDD_RRRR_PPPP_EEEE_RRRR_MMMM points to a
  249.                  memory address that is not in a valid part of the process
  250.                  address space.
  251.  
  252.      [EPERM]     The caller does not have permission to unblock or query the
  253.                  process specified by the second argument for the
  254.                  PPPPRRRR____UUUUNNNNBBBBLLLLKKKKOOOONNNNEEEEXXXXEEEECCCC, PPPPRRRR____IIIISSSSBBBBLLLLOOOOCCCCKKKKEEEEDDDD, PPPPRRRR____CCCCOOOORRRREEEEPPPPIIIIDDDD, or PPPPRRRR____GGGGEEEETTTTSSSSHHHHMMMMAAAASSSSKKKK
  255.                  options.
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. PPPPRRRRCCCCTTTTLLLL((((2222))))                                                              PPPPRRRRCCCCTTTTLLLL((((2222))))
  269.  
  270.  
  271.  
  272. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  273.      blockproc(2), signal(2), setrlimit(2), sproc(2), usinit(3P).
  274.  
  275. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  276.      Upon successful completion, _pppp_rrrr_cccc_tttt_llll returns the requested information.
  277.      Otherwise, a value of -1 is returned to the calling process, and _eeee_rrrr_rrrr_nnnn_oooo is
  278.      set to indicate the error.
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.